/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */

package org.apli.haiam.ejb.entidades;

import java.io.Serializable;
import java.util.List;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.Id;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.OneToMany;
import javax.persistence.Table;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Size;

/**
 *
 * @author Informática
 */
@Entity
@Table(name = "far_presentacion")
@NamedQueries({
    @NamedQuery(name = "FarPresentacion.findAll", query = "SELECT f FROM FarPresentacion f")})
public class FarPresentacion implements Serializable {
    private static final long serialVersionUID = 1L;
    @Id
    @Basic(optional = false)
    @NotNull
    @Column(name = "fpr_id")
    private Integer fprId;
    @Basic(optional = false)
    @NotNull
    @Size(min = 1, max = 64)
    @Column(name = "fpr_nombre")
    private String fprNombre;
    @OneToMany(mappedBy = "farPresentacion", fetch = FetchType.LAZY)
    private List<FarFormaFarmaceutica> farFormaFarmaceuticaList;

    public FarPresentacion() {
    }

    public FarPresentacion(Integer fprId) {
        this.fprId = fprId;
    }

    public FarPresentacion(Integer fprId, String fprNombre) {
        this.fprId = fprId;
        this.fprNombre = fprNombre;
    }

    public Integer getFprId() {
        return fprId;
    }

    public void setFprId(Integer fprId) {
        this.fprId = fprId;
    }

    public String getFprNombre() {
        return fprNombre;
    }

    public void setFprNombre(String fprNombre) {
        this.fprNombre = fprNombre;
    }

    public List<FarFormaFarmaceutica> getFarFormaFarmaceuticaList() {
        return farFormaFarmaceuticaList;
    }

    public void setFarFormaFarmaceuticaList(List<FarFormaFarmaceutica> farFormaFarmaceuticaList) {
        this.farFormaFarmaceuticaList = farFormaFarmaceuticaList;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (fprId != null ? fprId.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof FarPresentacion)) {
            return false;
        }
        FarPresentacion other = (FarPresentacion) object;
        if ((this.fprId == null && other.fprId != null) || (this.fprId != null && !this.fprId.equals(other.fprId))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "org.apli.haiam.ejb.entidades.FarPresentacion[ fprId=" + fprId + " ]";
    }
    
}
